package com.ymatou.iapi.payment.testcase;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.payment.parameter.AcquireOrderBean;
import com.ymatou.iapi.payment.parameter.CheckPaymentBean;
import com.ymatou.iapi.payment.parameter.PayOrderEnum;
import com.ymatou.iapi.payment.parameter.QueryBaofu;
import com.ymatou.iapi.payment.service.AutoPaymentCheckCall;
import com.ymatou.iapi.payment.service.CheckApplepayPaymentCall;
import com.ymatou.iapi.payment.service.CheckPaymentCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymttest.business.service.PayGateWayCallService;
import com.ymttest.database.model.Account;
import com.ymttest.database.model.AccountEntry;
import com.ymttest.database.model.MPayment;
import com.ymttest.database.sqlwapper.AccountWapper;
import com.ymttest.database.sqlwapper.PayGateWayWapper;
import com.ymttest.utils.BaofooSignature;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * 支付对账接口 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_CheckPayment {
	private static CheckPaymentBean checkpaymentBean;
	private static CheckPaymentCall checkpaymentCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("支付对账接口");
	}

	@Before
	public void caseUp() {
		checkpaymentBean = new CheckPaymentBean();
		checkpaymentCall = new CheckPaymentCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(checkpaymentCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_001() {
		Logger.start(true, "10支付宝PC未支付实时对账success,验证checkstatus成功-验证回写paytime-JIRACONN-32306");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//10");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			//var gmt_payment = header["MockResult-AliPay-gmt_payment".ToLower()] ?? "2019-01-01 01:01:01";    // 支付完成时间
			String time=YMTDateUtil.getBeforeOrNextDay(-1, YMTDateUtil.YMDHMS);
			m.put("MockResult-AliPay-gmt_payment", time);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			Logger.verifyEquals(time,YMTDateUtil.getFormatDateString(ppm.getPayTime(), YMTDateUtil.YMDHMS),"验证paytime");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_002() {
		Logger.start(true, "10支付宝PC已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//10");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_003() {
		Logger.start(false, "10支付宝PC未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//10");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_004() {
		Logger.start(false, "10支付宝PC已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//10");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_005() {
		Logger.start(false, "10支付宝PC未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//10");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_006() {
		Logger.start(true, "13支付宝-APP未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_007() {
		Logger.start(true, "13支付宝-APP已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_008() {
		Logger.start(false, "13支付宝-APP未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_009() {
		Logger.start(false, "13支付宝-APP已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_010() {
		Logger.start(false, "13支付宝-APP未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_011() {
		Logger.start(true, "14微信-JSAPI未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_012() {
		Logger.start(true, "14微信-JSAPI已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_013() {
		Logger.start(false, "14微信-JSAPI未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_014() {
		Logger.start(false, "14微信-JSAPI已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_015() {
		Logger.start(false, "14微信-JSAPI未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_016() {
		Logger.start(true, "15微信APP未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//15");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_017() {
		Logger.start(true, "15微信APP已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//15");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_018() {
		Logger.start(false, "15微信APP未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//15");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_019() {
		Logger.start(false, "15微信APP已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//15");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_020() {
		Logger.start(false, "15微信APP未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//15");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_021() {
		Logger.start(true, "50招行未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//50");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getCMBMap(aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_022() {
		Logger.start(true, "50招行已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//50");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getCMBMap(aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_023() {
		Logger.start(true, "50招行未支付实时对账failed,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//50");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getCMBMap(aqb.getPayPrice());
			m.put("MockResult-Cmb-rspCode", "Failed");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(0, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_024() {
		Logger.start(true, "50招行已支付实时对账failed,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//50");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getCMBMap(aqb.getPayPrice());
			m.put("MockResult-Cmb-rspCode", "Failed");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_025() {
		Logger.start(true, "50招行未支付实时对账failed最终对账,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//50");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getCMBMap(aqb.getPayPrice());
			m.put("MockResult-Cmb-rspCode", "Failed");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(0, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_026() {
		Logger.start(true, "50招行已支付实时对账MSS3206,验证checkstatus为unknown状态不变,JIRACONN-5757");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//50");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getCMBMap(aqb.getPayPrice());
			m.put("MockResult-Cmb-rspCode", "MSS3206");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(0, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_027() {
		Logger.start(true, "60ApplePay未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAppleMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_028() {
		Logger.start(true, "60applepay已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAppleMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_029() {
		Logger.start(false, "60applepay未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getAppleMockMap("A6", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_030() {
		Logger.start(false, "60applepay已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// 36与原交易信息不符
			Map m = getAppleMockMap("36", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_031() {
		Logger.start(false, "60applepay未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			// 62交易失败，发卡银行不支持该商户，请更换其他银行卡
			Map m = getAppleMockMap("62", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_032() {
		Logger.start(false, "60applepay已支付实时对账12重复交易,保持原状态");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			MPayment oldppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			checkpaymentBean.setPayType(aqb.getPayType());//60");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// 12重复交易
			Map m = getAppleMockMap("12", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(oldppm.getCheckStatus(), ppm.getCheckStatus(), "验证CheckStatus-code12不处理");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_033() {
		Logger.start(true, "AutoPaymentCheck对账");
		try {
			AutoPaymentCheckCall cpcall = new AutoPaymentCheckCall();
			cpcall.callService();
			// Logger.verifyEquals("ok", cpcall.getReturnData(), "验证返回结果");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// 手动确认
	public void Tc_CheckPayment_034() {
		Logger.start(true, "CheckApplepayPayment对账");
		try {
			CheckApplepayPaymentCall cpcall = new CheckApplepayPaymentCall();
			cpcall.callService();
			// Logger.verifyEquals("ok", cpcall.getReturnData(), "验证返回结果");
			// 数据库记录
			// select * from PP_PaymentCheck where PaymentChannel=60;
			//
			// SELECT * from PP_PaymentCheckDetail where PaymentCheckId=??
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_035() {
		Logger.start(true, "70宝付未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);

			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.debug("PayStatus:" + ppm.getPayStatus());

			checkpaymentBean.setPayType(aqb.getPayType());//70");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);

			QueryBaofu baofuq = initQueryBaofu(aqb, trandno);
			BaofooSignature bf = new BaofooSignature();
			String send = bf.encryptData(FormatUtil.beanToGSONString(baofuq));
			checkpaymentCall.addHeader("MockResult-BaofooPay-Result", send);
			checkpaymentCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			checkpaymentCall.addHeader("MockId", mockid);

			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);

			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.debug("PayStatus:" + ppm.getPayStatus());
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			Logger.verifyEquals(baofuq.getOrder_id(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
//			Logger.verifyEquals(baofuq.getVoucher_no(), ppm.getBankId(), "验证BankId");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_036() {
		Logger.start(true, "70宝付已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//70");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);

			QueryBaofu baofuq = initQueryBaofu(aqb, trandno);
			BaofooSignature bf = new BaofooSignature();
			String send = bf.encryptData(FormatUtil.beanToGSONString(baofuq));
			checkpaymentCall.addHeader("MockResult-BaofooPay-Result", send);
			checkpaymentCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			checkpaymentCall.addHeader("MockId", mockid);

			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_037() {
		Logger.start(false, "70宝付未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//70");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			QueryBaofu baofuq = initQueryBaofu(aqb, trandno);
			baofuq.setResp_code("0001");
			baofuq.setResp_msg("订单交易失败");
			BaofooSignature bf = new BaofooSignature();
			String send = bf.encryptData(FormatUtil.beanToGSONString(baofuq));
			checkpaymentCall.addHeader("MockResult-BaofooPay-Result", send);
			checkpaymentCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			checkpaymentCall.addHeader("MockId", mockid);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_038() {
		Logger.start(false, "70宝付未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//70");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			QueryBaofu baofuq = initQueryBaofu(aqb, trandno);
			baofuq.setResp_code("0001");
			baofuq.setResp_msg("订单交易失败");
			BaofooSignature bf = new BaofooSignature();
			String send = bf.encryptData(FormatUtil.beanToGSONString(baofuq));
			checkpaymentCall.addHeader("MockResult-BaofooPay-Result", send);
			checkpaymentCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			checkpaymentCall.addHeader("MockId", mockid);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_039() {
		Logger.start(false, "70宝付已支付实时对账重复交易,保持原状态");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//70");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// 12重复交易
			QueryBaofu baofuq = initQueryBaofu(aqb, trandno);
			baofuq.setResp_code("0009");
			baofuq.setResp_msg("重复交易");
			BaofooSignature bf = new BaofooSignature();
			String send = bf.encryptData(FormatUtil.beanToGSONString(baofuq));
			checkpaymentCall.addHeader("MockResult-BaofooPay-Result", send);
			checkpaymentCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			checkpaymentCall.addHeader("MockId", mockid);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(0, ppm.getCheckStatus(), "验证CheckStatus-code12不处理");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_040() {
		Logger.start(true, "50招行已支付实时对账success对账金额不正确,验证checkstatus失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//50");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getCMBMap(1+aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_041() {
		Logger.start(true, "60applepay已支付实时对账金额不正确,验证checkstatus失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAppleMockMap("00", Integer.valueOf(aqb.getPayPrice() +1), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_042() {
		Logger.start(true, "9.支付宝-花呗已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_043() {
		Logger.start(false, "9支付宝--花呗未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_044() {
		Logger.start(false, "9支付宝--花呗已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_045() {
		Logger.start(false, "9支付宝-花呗未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_046() {
		Logger.start(true, "17微信app小程序未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("17");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_047() {
		Logger.start(true, "17微信app小程序已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("17");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_048() {
		Logger.start(false, "17微信app小程序未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("17");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_049() {
		Logger.start(false, "17微信app小程序已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("17");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_050() {
		Logger.start(false, "14微信-JSAPI已支付实时对账通讯fail,做UNKNOW处理JIRACONN-19526");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			m.put("MockResult-WeiXin-return_code", "FAIL");
//			m.put("MockResult-WeiXin-result_code", "FAIL");
//			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(0, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_051() {
		Logger.start(true, "18直播微店未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("18");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_052() {
		Logger.start(true, "18直播微店已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("18");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_053() {
		Logger.start(false, "18直播微店未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("18");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_054() {
		Logger.start(false, "18直播微店已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("18");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_055() {
		Logger.start(true, "19海外直播扫货微信APP支付未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("19");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_056() {
		Logger.start(true, "19海外直播扫货微信APP支付已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("19");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_057() {
		Logger.start(false, "19海外直播扫货微信APP支付未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("19");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_058() {
		Logger.start(false, "19海外直播扫货微信APP支付已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("19");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_059() {
		Logger.start(true, "80翼支付未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("80");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getBestPayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_060() {
		Logger.start(true, "80翼支付已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("80");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getBestPayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_061() {
		Logger.start(false, "80翼支付未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("80");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getBestPayMockMap(aqb);
			m.put("MockResult-BestPay-transStatus", "G");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_062() {
		Logger.start(false, "80翼支付已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("80");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getBestPayMockMap(aqb);
			m.put("MockResult-BestPay-transStatus", "G");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_063() {
		Logger.start(true, "62upay-app未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_064() {
		Logger.start(true, "62upay-app已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_065() {
		Logger.start(false, "62upay-app未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getUPayMockMap("A6", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_066() {
		Logger.start(false, "62upay-app已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// 36与原交易信息不符
			Map m = getUPayMockMap("36", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_067() {
		Logger.start(true, "62upay-app未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_068() {
		Logger.start(true, "62upay-app已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_069() {
		Logger.start(false, "62upay-app未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getUPayMockMap("A6", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_070() {
		Logger.start(false, "63upay-wap已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("63");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// 36与原交易信息不符
			Map m = getUPayMockMap("36", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_071() {
		Logger.start(true, "3017全球优选-商城-微信小程序未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3017");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_072() {
		Logger.start(true, "3017全球优选-商城-微信小程序已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3017");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_073() {
		Logger.start(false, "3017全球优选-商城-微信小程序未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3017");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_074() {
		Logger.start(false, "3017全球优选-商城-微信小程序已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3017");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_075() {
		Logger.start(true, "64小米支付未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_076() {
		Logger.start(true, "64小米支付已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_077() {
		Logger.start(false, "64小米支付未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getUPayMockMap("A6", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_078() {
		Logger.start(false, "64小米支付已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// 36与原交易信息不符
			Map m = getUPayMockMap("36", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_079() {
		Logger.start(true, "14微信-JSAPI已支付实时对账success,验证checkstatus成功-微信立减");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			String discountAmt="1.00";
			PayGateWayCallService.notifyCall(aqb,discountAmt);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			String settle=new BigDecimal(aqb.getPayPrice()).subtract(new BigDecimal(discountAmt)).multiply(BigDecimal.valueOf(100)).setScale(0).toString();
			Logger.debug("settle:"+settle);
			m.put("MockResult-WeiXin-settlement_total_fee", settle);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_080() {
		Logger.start(false, "微信立减金额不正确,-15");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			String discountAmt="1.00";
			PayGateWayCallService.notifyCall(aqb,discountAmt);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			executerefundCall.addHeader("MockResult-WeiXin-total_fee", new BigDecimal(aqb.getPayPrice()).multiply(BigDecimal.valueOf(100)).setScale(0).toString());
//			executerefundCall.addHeader("MockResult-WeiXin-refund_fee", new BigDecimal(ar.getRefundAmt()).multiply(BigDecimal.valueOf(100)).setScale(0).toString());
//			executerefundCall.addHeader("MockResult-WeiXin-out_trade_no",ppm.getPaymentId());
//			executerefundCall.addHeader("MockResult-WeiXin-settlement_refund_fee", settle);
//			String settle=new BigDecimal(aqb.getPayPrice()).subtract(new BigDecimal(discountAmt)).multiply(BigDecimal.valueOf(100)).setScale(0).toString();
//			m.put("MockResult-WeiXin-settlement_refund_fee", settle);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_081() {
		Logger.start(true, "3013全球优选-支付宝App未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3013");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_082() {
		Logger.start(true, "3013全球优选-支付宝App已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3013");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_083() {
		Logger.start(false, "3013全球优选-支付宝App未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3013");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_084() {
		Logger.start(false, "3013全球优选-支付宝App已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3013");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_085() {
		Logger.start(true, "3015全球优选-微信App未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3015");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_086() {
		Logger.start(true, "3015全球优选-微信App已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3015");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_087() {
		Logger.start(false, "3015全球优选-微信App未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3015");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_088() {
		Logger.start(false, "3015全球优选-微信App已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3015");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_089() {
		Logger.start(true, "65.HuaweiPay未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_090() {
		Logger.start(true, "65.HuaweiPay已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_091() {
		Logger.start(false, "65.HuaweiPay未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getUPayMockMap("A6", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_092() {
		Logger.start(false, "65.HuaweiPay已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// 36与原交易信息不符
			Map m = getUPayMockMap("36", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_093() {
		Logger.start(true, "66.SamSungPay未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_094() {
		Logger.start(true, "66.SamSungPay已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getUPayMockMap("00", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_095() {
		Logger.start(false, "66.SamSungPay未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getUPayMockMap("A6", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_096() {
		Logger.start(false, "66.SamSungPay已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// 36与原交易信息不符
			Map m = getUPayMockMap("36", Integer.valueOf(aqb.getPayPrice() + "00"), trandno);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_097() {
		Logger.start(true, "6000.HipoPayWxApp未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount",  aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			Logger.debug(FormatUtil.beanToGSONString(ppm));
			Logger.verifyEquals(new BigDecimal( m.get("MockResult-Hipo-pay_amount").toString()).setScale(2), ppm.getOrderRmb().setScale(2), "验证OrderRmb");
			
			Logger.verifyEquals(new BigDecimal( m.get("MockResult-Hipo-exchange_rate").toString()).setScale(20,BigDecimal.ROUND_HALF_UP), new BigDecimal(ppm.getSettleRate()).setScale(20,BigDecimal.ROUND_HALF_UP), "验证getSettleCurrency");
			   BigDecimal settleAmount = BigDecimal.ONE.divide(new BigDecimal( ppm.getSettleRate()), 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
	                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
	                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
			Logger.verifyEquals(settleAmount.setScale(2,BigDecimal.ROUND_HALF_UP) ,ppm.getSettleAmount().setScale(2,BigDecimal.ROUND_HALF_UP), "验证settleAmount");
			
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
		        }
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_098() {
		Logger.start(true, "6000.HipoPayWxApp已经支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_099() {
		Logger.start(true, "6000.HipoPayWxApp未支付实时对账success,金额不正确,验证checkstatus-15");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount", 1+ aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(0, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_100() {
		Logger.start(false, "6000.HipoPayWxApp未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-status", "INIT");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_101() {
		Logger.start(false, "6000.HipoPayWxApp已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = new HashMap<String, String>();
			m.put("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			m.put("MockId", mockid);
			m.put("MockResult-Hipo-status", "INIT");
			m.put("MockResult-Hipo-is_success", true);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_102() {
		Logger.start(true, "9.支付宝-花呗已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("8");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_103() {
		Logger.start(false, "8支付宝--花呗未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("8");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_104() {
		Logger.start(false, "8支付宝--花呗已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("8");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_105() {
		Logger.start(false, "8支付宝-花呗未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("8");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_106() {
		Logger.start(true, "6001.HipoPayWxH5未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount",  aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			Logger.verifyEquals(new BigDecimal( m.get("MockResult-Hipo-pay_amount").toString()).setScale(2), ppm.getOrderRmb().setScale(2), "验证OrderRmb");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_107() {
		Logger.start(true, "6001.HipoPayWxH5已经支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_108() {
		Logger.start(true, "6001.HipoPayWxH5未支付实时对账success,金额不正确,验证checkstatus-15");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount", 1+ aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(0, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_109() {
		Logger.start(false, "6001.HipoPayWxH5未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-status", "INIT");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_120() {
		Logger.start(false, "6001.HipoPayWxH5已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = new HashMap<String, String>();
			m.put("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			m.put("MockId", mockid);
			m.put("MockResult-Hipo-status", "INIT");
			m.put("MockResult-Hipo-is_success", true);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	@Ignore
	//20190820 fql该功能降级不处理 fql需要第三方号来对因为checkpayment会返回多个结果 需要第三方号来对账
	public void Tc_CheckPayment_121() {
		Logger.start(true, "90分期乐未支付实时对账success,验证checkstatus成功-MockResult-FqlPay-merch_sale_state=12");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map mock = getFQLMockMap(aqb);
			mock.put("MockResult-FqlPay-order_id", TestDataManager.getRandomUUID().toString().replaceAll("-", ""));
			addMock(checkpaymentCall, mock);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			verifyFQLDB(aqb,mock);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_122() {
		Logger.start(true, "90分期乐已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getFQLMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_123() {
		Logger.start(false, "90分期乐未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getFQLMockMap(aqb);
			m.put("MockResult-FqlPay-merch_sale_state", "10");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_124() {
		Logger.start(false, "90分期乐已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getFQLMockMap(aqb);
			m.put("MockResult-FqlPay-merch_sale_state", "10");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	@Ignore
	//20190820 fql该功能降级不处理 fql需要第三方号来对因为checkpayment会返回多个结果 需要第三方号来对账
	public void Tc_CheckPayment_125() {
		Logger.start(true, "90分期乐未支付实时对账success,验证checkstatus成功-MockResult-FqlPay-merch_sale_state=14");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map mock = getFQLMockMap(aqb);
			mock.put("MockResult-FqlPay-merch_sale_state", "14");
			mock.put("MockResult-FqlPay-order_id", TestDataManager.getRandomUUID().toString().replaceAll("-", ""));
			addMock(checkpaymentCall, mock);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			verifyFQLDB(aqb,mock);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_126() {
		Logger.start(true, "90分期乐未支付实时对账success,验证checkstatus成功-MockResult-FqlPay-merch_sale_state=15");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map mock = getFQLMockMap(aqb);
			mock.put("MockResult-FqlPay-merch_sale_state", "15");
			mock.put("MockResult-FqlPay-order_id", TestDataManager.getRandomUUID().toString().replaceAll("-", ""));
			addMock(checkpaymentCall, mock);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			verifyFQLDB(aqb,mock);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_127() {
		Logger.start(true, "90分期乐未支付实时对账success,验证checkstatus成功-MockResult-FqlPay-merch_sale_state=17");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map mock = getFQLMockMap(aqb);
			mock.put("MockResult-FqlPay-merch_sale_state", "17");
			mock.put("MockResult-FqlPay-order_id", TestDataManager.getRandomUUID().toString().replaceAll("-", ""));
			addMock(checkpaymentCall, mock);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			verifyFQLDB(aqb,mock);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_128() {
		Logger.start(true, "90分期乐未支付实时对账success,验证checkstatus成功-MockResult-FqlPay-merch_sale_state=18");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map mock = getFQLMockMap(aqb);
			mock.put("MockResult-FqlPay-merch_sale_state", "18");
			mock.put("MockResult-FqlPay-order_id", TestDataManager.getRandomUUID().toString().replaceAll("-", ""));
			addMock(checkpaymentCall, mock);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			verifyFQLDB(aqb,mock);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_129() {
		Logger.start(true, "90分期乐已支付实时对账金额不正确failed,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("90");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getFQLMockMap(aqb);
			m.put("MockResult-FqlPay-amount",1+aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_130() {
		Logger.start(true, "3113全球优选-支付宝App未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3113");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_131() {
		Logger.start(true, "3115全球优选-微信App未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3115");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_132() {
		Logger.start(true, "3117全球优选-商城-微信小程序未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3117");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_133() {
		Logger.start(true, "3213全球优选-鱼多多支付宝App未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3213");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_134() {
		Logger.start(true, "3215全球优选-鱼多多微信App未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3215");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_135() {
		Logger.start(true, "2013抖音支付宝-APP未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("2013");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_136() {
		Logger.start(true, "2013抖音支付宝-APP已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("2013");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_137() {
		Logger.start(false, "2013抖音支付宝-APP未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("2013");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_138() {
		Logger.start(false, "2013抖音支付宝-APP已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("2013");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_139() {
		Logger.start(false, "2013抖音支付宝-APP未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("2013");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_140() {
		Logger.start(true, "91分期乐小程序已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("91");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//14");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getFQLMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_141() {
		Logger.start(true, "6002HipoPay-微信H5飛界國際電子商務未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6002");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount",  aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			Logger.verifyEquals(new BigDecimal( m.get("MockResult-Hipo-pay_amount").toString()).setScale(2), ppm.getOrderRmb().setScale(2), "验证OrderRmb");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_142() {
		Logger.start(true, "6002HipoPay-微信H5飛界國際電子商務已经支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6002");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_143() {
		Logger.start(true, "6010盛付通微信小程序未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			
			Logger.debug(FormatUtil.beanToGSONString(ppm));
			Logger.verifyEquals(new BigDecimal( m.get("MockResult-ShengPay-orderAmount").toString()).setScale(2), ppm.getOrderRmb().setScale(2), "验证OrderRmb");
			
			Logger.verifyEquals(new BigDecimal( 1).setScale(20,BigDecimal.ROUND_HALF_UP), new BigDecimal(ppm.getSettleRate()).setScale(20,BigDecimal.ROUND_HALF_UP), "验证getSettleCurrency");
			   BigDecimal settleAmount = BigDecimal.ONE.divide(new BigDecimal( ppm.getSettleRate()), 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
	                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
	                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
			Logger.verifyEquals(settleAmount.setScale(2,BigDecimal.ROUND_HALF_UP) ,ppm.getSettleAmount().setScale(2,BigDecimal.ROUND_HALF_UP), "验证settleAmount");
			
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			for (Map mock : mocks) {
				Logger.debug(FormatUtil.beanToGSONString(mock));
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
				//TODO 增加汇率和计算后金额
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
		        }
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_144() {
		Logger.start(true, "6010盛付通微信小程序已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_145() {
		Logger.start(false, "6010盛付通微信小程序未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			m.put("MockResult-ShengPay-transStatus", "02");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_146() {
		Logger.start(false, "6010盛付通微信小程序已支付实时对账fail,验证checkstatus成功-金额不正确");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			m.put("MockResult-ShengPay-transAmount",1+aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_147() {
		Logger.start(true, "6011盛付通微信公众号未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6011");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(m.get("MockResult-ShengPay-sftOrderNo").toString(), ppm.getInstitutionPaymentId(), "验证MockResult-ShengPay-sftOrderNo");
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_148() {
		Logger.start(false, "6010盛付通微信小程序已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			m.put("MockResult-ShengPay-transStatus", "02");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_149() {
		Logger.start(true, "6011盛付通公众号未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6011");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_150() {
		Logger.start(true, "6010盛付通微信小程序已支付实时对账-status退款中04,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			m.put("MockResult-ShengPay-transStatus", "04");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_151() {
		Logger.start(true, "6010盛付通微信小程序已支付实时对账-status退款成功05,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getSFTMockMap(aqb);
			m.put("MockResult-ShengPay-transStatus", "05");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_152() {
		Logger.start(true, "6006代购神器HipoPayAliWap未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6006");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount",  aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_153() {
		Logger.start(true, "6100GodAliPayPc未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6100");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//13");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_154() {
		Logger.start(true, "6103.HipoPay-微信app未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount",  aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			Logger.verifyEquals(new BigDecimal( m.get("MockResult-Hipo-pay_amount").toString()).setScale(2), ppm.getOrderRmb().setScale(2), "验证OrderRmb");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_155() {
		Logger.start(true, "6103.HipoPay-微信app已经支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_156() {
		Logger.start(true, "6103.HipoPay-微信app未支付实时对账success,金额不正确,验证checkstatus-15");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount", 1+ aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(0, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_157() {
		Logger.start(false, "6103.HipoPay-微信app未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-status", "INIT");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_158() {
		Logger.start(false, "6103.HipoPay-微信app已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = new HashMap<String, String>();
			m.put("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			m.put("MockId", mockid);
			m.put("MockResult-Hipo-status", "INIT");
			m.put("MockResult-Hipo-is_success", true);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_159() {
		Logger.start(true, "6107.HipoPay-支付宝app未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount",  aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			Logger.verifyEquals(new BigDecimal( m.get("MockResult-Hipo-pay_amount").toString()).setScale(2), ppm.getOrderRmb().setScale(2), "验证OrderRmb");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_160() {
		Logger.start(true, "6107.HipoPay-支付宝app已经支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_161() {
		Logger.start(true, "6107.HipoPay-支付宝app未支付实时对账success,金额不正确,验证checkstatus-15");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount", 1+ aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-15, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(0, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_162() {
		Logger.start(false, "6107.HipoPay-支付宝app未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			// A6在对账时是失败
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-status", "INIT");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(m.get("MockId").toString());
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_163() {
		Logger.start(false, "6107.HipoPay-支付宝app已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = new HashMap<String, String>();
			m.put("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			m.put("MockId", mockid);
			m.put("MockResult-Hipo-status", "INIT");
			m.put("MockResult-Hipo-is_success", true);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_164() {
		Logger.start(true, "6003HipoPay-微信H5飛界國際未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6003");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			m.put("MockResult-Hipo-amount",  aqb.getPayPrice());
			addMock(checkpaymentCall, m);
			
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
			Logger.verifyEquals(new BigDecimal( m.get("MockResult-Hipo-pay_amount").toString()).setScale(2), ppm.getOrderRmb().setScale(2), "验证OrderRmb");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_165() {
		Logger.start(true, "6003HipoPay-微信H5飛界國際已经支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6003");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getHipoPayWxAppMockMap("true", aqb.getPayPrice(), PayGateWayCallService.HKExchangeRate);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_166() {
		Logger.start(true, "4013支付宝-APP未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4013");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4013");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_167() {
		Logger.start(true, "4013支付宝-APP已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4013");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4013");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_168() {
		Logger.start(false, "4013支付宝-APP未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4013");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4013");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_169() {
		Logger.start(false, "4013支付宝-APP已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4013");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4013");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_CheckPayment_170() {
		Logger.start(false, "4013支付宝-APP未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4013");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4013");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getAlipayMockMap(aqb);
			m.put("MockResult-AliPay-is_success", "N");
			m.put("MockResult-AliPay-error", "TRADE_NOT_EXIST");
			m.put("MockResult-AliPay-trade_status", "TRADE_NOT_EXIST");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_171() {
		Logger.start(true, "4016微信APP未支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4016");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4016");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_172() {
		Logger.start(true, "4016微信APP已支付实时对账success,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4016");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4016");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_173() {
		Logger.start(false, "4016微信APP未支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4016");
			PayGateWayCallService.acquireOrder(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4016");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_174() {
		Logger.start(false, "4016微信APP已支付实时对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4016");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4016");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(false);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-20, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_CheckPayment_175() {
		Logger.start(false, "4016微信APP未支付最终对账fail,验证checkstatus成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4016");
			PayGateWayCallService.acquireOrder(aqb);
			// PayGateWayCallService.notifyCall(aqb);
			String trandno = getPaymentId(aqb);
			checkpaymentBean.setPayType(aqb.getPayType());//4016");
			checkpaymentBean.setPaymentId(trandno);
			checkpaymentBean.setFinalCheck(true);
			checkpaymentCall.setData(checkpaymentBean);
			Map m = getWeiXinMockMap(aqb);
//			m.put("MockResult-WeiXin-return_code", "FAIL");
			m.put("MockResult-WeiXin-result_code", "FAIL");
			m.put("MockResult-WeiXin-trade_state", "NOTPAY");
			addMock(checkpaymentCall, m);
			checkpaymentCall.callService();
			Logger.verifyEquals("ok", checkpaymentCall.getReturnData(), "验证返回结果");
			Thread.sleep(2000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(-10, ppm.getCheckStatus(), "验证CheckStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	private Map getSFTMockMap(AcquireOrderBean aqb) throws Exception {
		Logger.comment("获取默认的盛付通信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		MPayment ppm = PayGateWayCallService.getPPayment(aqb);
		
//		MockResult-ShengPay-returnCode: 00
		m.put("MockResult-ShengPay-returnCode", "01");
//		MockResult-ShengPay-transStatus: 01
		m.put("MockResult-ShengPay-transStatus", "01");
//		MockResult-ShengPay-transTime: 0266666666666
		m.put("MockResult-ShengPay-transTime", YMTDateUtil.getDate().getTime());
//		MockResult-ShengPay-merchantOrderNo: merchantOrderNo-01
		m.put("MockResult-ShengPay-merchantOrderNo", ppm.getPaymentId());
//		MockResult-ShengPay-sftOrderNo: ssssssss----1
		m.put("MockResult-ShengPay-sftOrderNo", ppm.getInstitutionPaymentId()!=null?ppm.getInstitutionPaymentId():TestDataManager.getRandomUUID().toString());
//		MockResult-ShengPay-orderAmount: 3.01
		m.put("MockResult-ShengPay-orderAmount",aqb.getPayPrice());
//		MockResult-ShengPay-transAmount: 10.1
		m.put("MockResult-ShengPay-transAmount",aqb.getPayPrice());
		
		
//		m.put("MockResult-FqlPay-merch_sale_state", "12");
////		m.put("MockResult-BestPay-transAmt", new BigDecimal(ppm.getOrderAmt().multiply(BigDecimal.valueOf(100)).setScale(0).toString()));
//		m.put("MockResult-FqlPay-third_order_id",ppm.getPaymentId());
//		m.put("MockResult-FqlPay-order_id", ppm.getInstitutionPaymentId());
//		m.put("MockResult-FqlPay-amount",aqb.getPayPrice());
		return m;
	}

	private void verifyFQLDB(AcquireOrderBean aqb,Map mock) throws InterruptedException {
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Integer fqlstate=Integer.valueOf(mock.get("MockResult-FqlPay-merch_sale_state").toString());
		if(!(fqlstate.equals(12)||fqlstate.equals(14))) {
			Logger.verifyEquals(-1, ppm.getCheckStatus(), "验证CheckStatus");
			Logger.verifyEquals(0, ppm.getPayStatus(), "验证PayStatus");
			return;
		}
		Logger.verifyEquals(2, ppm.getCheckStatus(), "验证CheckStatus");
		Logger.verifyEquals(1, ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("156", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(mock.get("MockResult-FqlPay-order_id"), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");

		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		List<AccountEntry> list = new AccountWapper().selectAccountEntryByBizNo(m);
		Logger.verifyEquals(1, list.size(), "验证资金条数");
		AccountEntry actinfo = list.get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}else if (aqb.getBizCode().equals("6")) {
			Logger.verifyEquals("100007", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("预售定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:预售定金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}
		
	}
	private Map getFQLMockMap(AcquireOrderBean aqb) throws Exception {
		Logger.comment("获取默认的分期乐信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		MPayment ppm = PayGateWayCallService.getPPayment(aqb);
		m.put("MockResult-FqlPay-merch_sale_state", "12");
//		m.put("MockResult-BestPay-transAmt", new BigDecimal(ppm.getOrderAmt().multiply(BigDecimal.valueOf(100)).setScale(0).toString()));
		m.put("MockResult-FqlPay-third_order_id",ppm.getPaymentId());
		m.put("MockResult-FqlPay-order_id", ppm.getInstitutionPaymentId());
		m.put("MockResult-FqlPay-amount",aqb.getPayPrice());
		return m;
	}

	private QueryBaofu initQueryBaofu(AcquireOrderBean aqb, String trandno) {
		QueryBaofu qbf = new QueryBaofu();
		Integer price = new BigDecimal(aqb.getPayPrice()).multiply(new BigDecimal(100)).intValue();
		qbf.setSucc_amt(price.toString());
		qbf.setResp_code("0000");
		qbf.setResp_msg("成功");
		qbf.setTrans_id(trandno);
		
		qbf.setData_type("json");
		qbf.setMember_id(PayGateWayCallService.BaoFu_MERID);
		qbf.setTerminal_id(PayGateWayCallService.BaoFu_TerminalID);
		qbf.setTrade_date(YMTDateUtil.getSysTime("yyyyMMddHHmmss"));
		qbf.setTxn_sub_type("08");
		qbf.setTxn_type("20199");
		qbf.setOrder_id(TestDataManager.getRandomUUID().toString());
		qbf.setVoucher_no(TestDataManager.getRandomUUID().toString().replaceAll("-", ""));
		return qbf;
	}
	private Map getBestPayMockMap(AcquireOrderBean aqb) throws Exception {
		Logger.comment("获取默认的翼支付信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		MPayment ppm = PayGateWayCallService.getPPayment(aqb);
		m.put("MockResult-BestPay-success", "true");
		m.put("MockResult-BestPay-transAmt", new BigDecimal(ppm.getOrderAmt().multiply(BigDecimal.valueOf(100)).setScale(0).toString()));
		m.put("MockResult-BestPay-merchantId",PayGateWayCallService.BESTPAY_MERID);
		m.put("MockResult-BestPay-orderNo",ppm.getPaymentId());
		m.put("MockResult-BestPay-orderReqNo",ppm.getPaymentId());
		m.put("MockResult-BestPay-ourTransNo", ppm.getInstitutionPaymentId());
		m.put("MockResult-BestPay-transStatus", "B");
		m.put("MockResult-BestPay-orderDate", YMTDateUtil.getBeforeOrNextDay(0, "yyyyMMddHHmmss"));
		return m;
	}
	private Map getWeiXinMockMap(AcquireOrderBean aqb) throws Exception {
		Logger.comment("获取默认的WeiXinMock信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		m.put("MockResult-WeiXin-return_code", "SUCCESS");
		m.put("MockResult-WeiXin-result_code", "SUCCESS");
		m.put("MockResult-WeiXin-trade_state", "SUCCESS");
		MPayment ppm = PayGateWayCallService.getPPayment(aqb);
		m.put("MockResult-WeiXin-total_fee", new BigDecimal(aqb.getPayPrice()).multiply(BigDecimal.valueOf(100)).setScale(0).toString());
		m.put("MockResult-WeiXin-refund_fee", new BigDecimal(aqb.getPayPrice()).multiply(BigDecimal.valueOf(100)).setScale(0).toString());
		m.put("MockResult-WeiXin-out_trade_no",ppm.getPaymentId());
		m.put("MockResult-WeiXin-settlement_total_fee", "-1");
		return m;
	}

	private Map getCMBMap(String payprice) {
		Logger.comment("获取默认的CMBMock信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		m.put("MockResult-Cmb-rspCode", "SUC0000");
		m.put("MockResult-Cmb-cardType", "02");
		m.put("MockResult-Cmb-orderAmount", payprice);
		m.put("MockResult-Cmb-discountAmount", "0.00");
		m.put("MockResult-Cmb-orderStatus", "0");
		m.put("MockResult-Cmb-date", YMTDateUtil.getSysTime("yyyyMMdd"));
		return m;
	}

	/**
	 * 获取默认的AlipayMock信息
	 * 
	 * @return
	 */
	private Map getAlipayMockMap(AcquireOrderBean aqb) {
		Logger.comment("获取默认的AlipayMock信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		m.put("MockResult-AliPay-is_success", "T");
		m.put("MockResult-AliPay-error", "OK");
		m.put("MockResult-AliPay-trade_status", "TRADE_SUCCESS");
		m.put("MockResult-AliPay-total_fee",new BigDecimal(aqb.getPayPrice()).setScale(2).toString());
		return m;
	}

	/**
	 * ApplepayMock
	 * 
	 * @param paice
	 *            金额 单位分
	 * @param orderid
	 *            订单号
	 * @param code
	 *            返回报文origRespCode
	 * @return
	 */
	private Map getAppleMockMap(String code, Integer paice, String orderid) {
		Logger.comment("获取默认的ApplepayMock信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		m.put("MockResult-ApplePay-origRespCode", code);
		m.put("MockResult-ApplePay-settleAmt", paice);
		m.put("MockResult-ApplePay-orderId", orderid);
		m.put("MockResult-ApplePay-merId", PayGateWayCallService.APPLEPAY_MERID);
		return m;
	}
	private Map getUPayMockMap(String code, Integer paice, String orderid) {
		Logger.comment("获取默认的UpayMock信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		m.put("MockResult-ApplePay-origRespCode", code);
		m.put("MockResult-ApplePay-settleAmt", paice);
		m.put("MockResult-ApplePay-orderId", orderid);
		m.put("MockResult-ApplePay-merId", PayGateWayCallService.UPAY_MERID);
		return m;
	}
	private Map getHipoPayWxAppMockMap(String success, String paice, String exchange_rate) {
		Logger.comment("获取默认的HipoPayMock信息");
		Map m = new HashMap<String, String>();
		m.put("Mock", "1");
		String mockid = TestDataManager.getRandomUUID().toString();
		m.put("MockId", mockid);
		m.put("MockResult-Hipo-is_success", success);
		m.put("MockResult-Hipo-amount", paice);
		m.put("MockResult-Hipo-exchange_rate", exchange_rate);
		m.put("MockResult-Hipo-status", "PAID");
		m.put("MockResult-Hipo-settle_currency", "HKD");
		m.put("MockResult-Hipo-trade_time", YMTDateUtil.getBeforeOrNextDay(0, "yyyy-MM-dd HH:mm:ss"));
		BigDecimal orderRmb=new BigDecimal(paice).divide(new BigDecimal(exchange_rate),2,BigDecimal.ROUND_DOWN);
		m.put("MockResult-Hipo-pay_amount", orderRmb.toString());
		return m;
	}
	private void addMock(CheckPaymentCall cpcall, Map m) {
		Logger.comment("初始化MockHeader信息:" + m.toString());
		Set sl = m.entrySet();
		for (Object o : sl) {
			String[] ss = o.toString().split("=");
			String value = FormatUtil.urlEncode(ss[1]);
			cpcall.addHeader(ss[0], value);
		}
	}

	/**
	 * 获取PaymentId
	 * 
	 * @param aqb
	 *            收单bean
	 * @return 对应的PaymentId
	 * @throws Exception
	 */
	private String getPaymentId(AcquireOrderBean aqb) throws Exception {
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		return trandno;
	}

}